<link type="text/css" href="/admins/js/pagerView/pager-view.css" rel="stylesheet" />
<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/admins/js/pagerView/pager-view.js"></script>
<script type="text/javascript">
    $(function(){
    
        $.datepicker.setDefaults( $.datepicker.regional[ "zh-CN" ] );
        $( "#form1 #dateinbegin" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
        $( "#form1 #dateinend" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
    });
</script>
<form action="/admini/manageuser/mail/" method="get" style="margin:0px" id="form1">
    <div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;" id='sel'>
        <label for="member">用户：</label><input type="text" id="username" name="username" value="<?php echo $this->username; ?>" />
        <label for="starttime">发布时间：</label><input type="text" id="dateinbegin" name="dateinbegin" value="<?php echo $this->dateinbegin; ?>" />
        <label for="endtime">--</label><input type="text" id="dateinend" name="dateinend" value="<?php echo $this->dateinend; ?>" />
        <input type="submit" id="queryButton" value="查询"/>
    </div>
</form>
    <div class="dataTable">
        <table>  
            <tfoot>
             <tr>
                 <td colspan="14">
                     <button class="button" id="release-button" style="background-color: #1668A4;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;">发布新消息</button>
                     <button class="button" id="releaseAll-button" style="background-color: #1668A4;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;">群发新消息</button>
                 </td></tr>
            </tfoot>
            <tr>
                <th class="w1" width="2%">序号</th>
                <th class="w2" width="8%">用户</th>
                <th class="w3" width="5%">类型</th>	
                <th class="w4" width="20%">标题</th>
                <th class="w5" width="900px">内容</th>
                <th class="w6" width="5%">状态</th>
                <th class="w7" width="5%">发布时间</th>
            </tr>  
        
            <?php if($this->mailalllist != ''){
                foreach ($this->mailalllist as $Item) { ?> 
                <tr>
                    <td class="w1" nowrap align="center"><?php echo $Item->id; ?></td>
                    <td class="w2" nowrap align="center"><?php echo $Item->userinfo!=null?$Item->userinfo->nikename:($Item->userinfo==0?"群发消息":"用户出错"); ?></td>
                    <td class="w3" nowrap align="center"><?php echo $Item->type==1?"系统消息":"交易消息"; ?></td>
                    <td class="w4" nowrap><?php echo $Item->title;?></td>
                    <td class="w5" width="900px"><?php echo $Item->message; ?></td>
                    <td class="w6" nowrap align="center"><?php echo $Item->status==1?"已读":"未读"; ?></td>
                    <td class="w7" nowrap><?php echo $Item->dateCreated; ?></td>
                 </tr>         
            <?php } }?>
        </table>
    </div>                
    <div class="toolbar">
        <?php if($this->mailalllist): ?>
        <?php echo $this->partial('paging.phtml', array("pages" => $this->mailall,"pamas"=>"username=".$this->username."&dateinbegin=$this->dateinbegin&dateinend=$this->dateinend")); ?>
        <?php endif; ?>
    </div>   
<script type="text/javascript">
    $('#release-button').click(function(){
        location.href='/admini/manageuser/releasemg/';
    });
    $("#releaseAll-button").click(function(){
        location.href='/admini/manageuser/releasemgall'
    });
</script>